package com.caochenlei.iterator;

public class Client {
    public static void main(String[] args) {
        Aggregate ag = new ConcreteAggregate();
        ag.add("张三");
        ag.add("李四");
        ag.add("王五");
        Iterator it = ag.getIterator();
        while (it.hasNext()) {
            Object object = it.next();
            System.out.println(object.toString());
        }
    }
}
